#include "media_osd.h"

#include <inttypes.h>
#include <string.h>
#include <sys/time.h>
#include <vector>
#include <cassert>
#include <memory>
#include "utils_log.h"
#include "common_config_manager.h"

namespace El {
namespace Media {

OSDManager &OSDManager::GetInstance()
{
    static OSDManager instance;
    return instance;
}

OSDManager::OSDManager() {}

OSDManager::~OSDManager() {}

bool OSDManager::Start()
{
    HAL_OSD_FONT_S fontFile;
    memset(&fontFile, 0, sizeof(HAL_OSD_FONT_S));
    strncpy(fontFile.cFilename, "/usr/share/fonts/SourceHanSansCN-Normal.ttf", sizeof(fontFile.cFilename) - 1);
    Hal_Osd_Init(&fontFile);

    HAL_OSD_CFG_S pCfg;
    memset(&pCfg, 0, sizeof(HAL_OSD_CFG_S));
    pCfg.bShow = true;
    pCfg.bAdaptive = true;
    pCfg.eSize = OSD_FONT_SIZE_32;
    pCfg.u8Idx = HAL_OSD_TIME_IDX;
    pCfg.stPoint.u32X = 5;
    pCfg.stPoint.u32Y = 10;
    pCfg.stTime.b12hour = true;
    pCfg.stTime.bShowWeek = false;
    pCfg.stTime.eDataType = OSD_DATE_TYPE_ENG_YMD_CROSS;
    Hal_Osd_String(0, &pCfg);
    return true;
}

void OSDManager::Stop() {}

} // namespace Media
} // namespace El
